package com.matrix.java.chap_03;

import java.util.Scanner;

/*
    几何：点的位置
 */
public class Ex3_32 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter three points for pO, p1, and p2: ");
        double x0 = input.nextDouble();
        double y0 = input.nextDouble();
        double x1 = input.nextDouble();
        double y1 = input.nextDouble();
        double x2 = input.nextDouble();
        double y2 = input.nextDouble();
        double result = (x1-x0)*(y2-y0)-(x2-x0)*(y1-y0);
        if (result==0){
            System.out.println("on the line");
        }else if (result >0){
            System.out.println("on the left side of the line");
        }else {
            System.out.println("on the right side of the line");
        }
        input.close();
    }
}
